{% extends "base.html" %}

{% block greybox %}
{% endblock %}

{% block formJs %}
<script type="text/javascript" src="/js/send.js"></script>
{% endblock %}

{% block js %}
/**
 * Post form data
 */
function postForm() {
    $.ajax({
        url : '/send/{{ result.key }}',
        data : {
            key : '{{ result.key }}',
            to_address : $('#contact-toAddress').val(),
            from_address : $('#contact-fromAddress').val(),
            title : $('#contact-title').val(),
            body : $('#contact-body').val()
        },
        type : 'post',
        dataType : 'jsonp',
        complete : function(){
            parent.parent.location.reload();
            parent.parent.GB_hide();
        }
    });
}
{% endblock %}

{% block header %}
{% endblock %}

{% block body %}

<div id="content">
    <p>次のフォームからメールを送信して「{{ result.title }}」の地図ページ URL を共有する事が出来ます。</p>
  
    <div id="edit-container">
        <table id="edit" class="contact-content" summary="sendForm">
            <tr>
                <td class="label" for="toAddress">To アドレス:</td>
                <td><input type="text" id="contact-toAddress" class="contact-input" name="contact-toAddress" tabindex="1000"/></td>
            </tr>
            <tr>
                <td class="label" for="fromAddress">From アドレス:</td>
                <td><input type="text" id="contact-fromAddress" class="contact-input" name="contact-fromAddress" tabindex="1001"/></td>
            </tr>
            <tr>
                <td class="label" for="title">タイトル:</td>
                <td><input type="text" id="contact-title" class="contact-input" name="title" tabindex="1002" value="{{ mail.mail_title }}"/></td>
            </tr>
            <tr>
                <td class="label" for="body">本文:</td>
                <td>
                    <textarea id="contact-body" class="contact-input" name="body" cols="40" rows="14" tabindex="1003">{{ result.title }}
{{ app.url }}key/{{ result.key }}

{{ mail.mail_footer }}</textarea>
                </td>
            </tr>
        </table>
            
        <div style="margin-left:100px;">
            <input type="submit" id="send" value="送信" tabindex="1006" />
        </div>
    </div>
</div>

{% endblock %}

{% block footer %}
{% endblock %}